<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        
var chance = 0.0557,i=1,
       baoji = chance,
       count = 0,
       rand;
function play(){
      var date = new Date();
       rand = date.getMilliseconds()/1000;
      
        if(rand<baoji){  
             //触发暴击//
            count++;
            console.log("当前第"+i+"次攻击，暴击次数"+count+"次","当前触发概率："+baoji+
            "实际概率"+count/i);
            baoji = chance;
        }
        else{
            console.log("当前第"+i+"次攻击，暴击次数"+count+"次","当前触发概率："+baoji+
            "实际概率"+count/i);
            //暴击值增加
            baoji+=chance;

            //进行下一次攻击
        }
        i++;
    }
      setInterval(function(){play()},1000);


    </script>
</body>

</html>